﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Chain_List" CodeFile="Chain_List.aspx.cs"
    MasterPageFile="~/MasterPage.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <title>经销商</title>

    <script src="../JavaScript/empchecks.js" type="text/javascript"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <input id="txtHidChains" type="hidden" runat="server" />
    <input id="txtHidOrg" type="hidden" runat="server" />
    <div>
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle" colspan="6">
                    <asp:Literal ID="Literal6" runat="server" Text="<%$resources:language,lbl_Query_Condition %>"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="tablefield">
                    经销商名称
                </td>
                <td nowrap="nowrap">
                    <asp:TextBox runat="server" ID="txtChain" MaxLength="20" Width="130px"></asp:TextBox>
                </td>
                <td class="tablefield">
                    经销商编号
                </td>
                <td nowrap="nowrap">
                    <asp:TextBox runat="server" ID="txtCode" MaxLength="20" Width="130px"></asp:TextBox>
                </td>
                <td class="tablefield">
                </td>
                <td nowrap="nowrap">
                </td>
            </tr>
            <tr>
                <td class="tablefield">
                    状态
                </td>
                <td nowrap="nowrap">
                    <asp:DropDownList ID="ddlStatus" runat="server">
                        <asp:ListItem Value="">--所有--</asp:ListItem>
                        <asp:ListItem Value="1" Selected="True">已分配</asp:ListItem>
                        <asp:ListItem Value="0">未分配</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td class="tablefield">
                    &nbsp;
                </td>
                <td nowrap="nowrap">
                    &nbsp;
                </td>
                <td class="tablefield">
                    &nbsp;
                </td>
                <td nowrap="nowrap">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td class="buttonarea" colspan="6">
                    <asp:Button ID="btnQuery" runat="server" class="wsd_button2" Text="<%$resources:language,btn_Query %>"
                        OnClick="btnQuery_Click" />
                </td>
            </tr>
        </table>
        <br />
        <table id="wsd_inputtable">
            <tr>
                <td class="tabletitle">
                    <asp:Literal ID="Literal4" runat="server" Text="<%$resources:language,lbl_ChainList %>"></asp:Literal>
                </td>
            </tr>
        </table>
        <table id="wsd_listtable" width="100%">
            <tr>
                <td style="width: 100%">
                    <asp:GridView BorderWidth="0" Width="100%" ID="gvChannelType" runat="server" AutoGenerateColumns="False"
                         QueryName="ChainList"
                        EmptyDataText="<%$ resources:language,lbl_Empty %>" EmptyDataRowStyle-Font-Bold="true"
                        EmptyDataRowStyle-HorizontalAlign="Center" OnRowDataBound="Grid_RowDataBound"
                        EnableEmptyContentRender="true" OnRowCommand="gvChannelType_RowCommand" AllowPaging="True"
                        OnPageIndexChanging="gvChannelType_PageIndexChanging" PageSize="20" DataKeyNames="ID,INCLUDE">
                        <HeaderStyle CssClass="titlist" />
                        <EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="True"></EmptyDataRowStyle>
                        <Columns>
                            <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="Chain_Maintain.aspx?id={0}"
                                ControlStyle-Font-Underline="false" DataTextField="CODE" HeaderText="经销商代码">
                                <ControlStyle Font-Underline="False"></ControlStyle>
                            </asp:HyperLinkField>
                            <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="Chain_Maintain.aspx?id={0}"
                                ControlStyle-Font-Underline="false" DataTextField="DESCRIPTION" HeaderText="描述">
                                <ControlStyle Font-Underline="False"></ControlStyle>
                            </asp:HyperLinkField>
                            <asp:TemplateField HeaderText="是否已分配组织" ItemStyle-HorizontalAlign="center" HeaderStyle-HorizontalAlign="center">
                                <ItemTemplate>
                                    <b>
                                        <%# Eval("INCLUDE").ToString() == "1" ? "<font size='3' color='green'>√</font>" : "<font size='3' color='red'>×</font>"%></b>
                                </ItemTemplate>
                                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="全选">
                                <HeaderTemplate>
                                    <asp:CheckBox runat="server" ID="cbxAllSelected" AutoPostBack=true OnCheckedChanged ="SelectALL"   />全选
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox runat="server" ID="cbxSelected" Checked='<%# Eval("INCLUDE").ToString() == "1"%>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="Chain_Customer.aspx?id={0}"
                                ControlStyle-Font-Underline="false" Text="挂接门店">
                                <ControlStyle Font-Underline="False"></ControlStyle>
                            </asp:HyperLinkField>
                        </Columns>
                        <RowStyle CssClass="evenline" />
                        <AlternatingRowStyle CssClass="oddline" />
                        <PagerSettings FirstPageText="<%$ resources:language, lbl_First_Page%>" LastPageText="<%$ resources:language, lbl_Last_Page%>"
                            Mode="NumericFirstLast" PageButtonCount="30" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
        <br />
        <table id="wsd_inputtable">
            <tr>
                <td width="100%" class="tabletitle">
                    <asp:Literal ID="Literal5" runat="server" Text="<%$resources:language,lbl_Operation_Area %>"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td class="buttonarea">
                    <asp:Button ID="btnAssign" runat="server" class="wsd_button2" Text="保  存" OnClientClick="return confirm('如果当前选定存在取消关联会清空该组织下的门店与经销商的关系,您确认要继续吗?')"
                        OnClick="btnAssign_Click" />
                    &nbsp;&nbsp;
                    <asp:Button ID="btnNew" runat="server" class="wsd_button2" Text="<%$resources:language,btn_Add %>"
                        OnClick="btnNew_Click" Visible="False" />
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
